﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using MuaChungDAO;
using MuaChungDAO;
using System.Data;

namespace DoAnMuaChung.Deal
{
    public partial class GioiThieuDeal : System.Web.UI.Page
    {
        public string gioiThieu = "";
        public string tenDoanhNghiep = "";

        public bool soBangGiaNhieuHon1 = false; // kiểm tra để hiện thêm số thứ tự bảng giá

        protected void Page_Load(object sender, EventArgs e)
        {
            string dealId = Request.QueryString["DealID"];
            System.Data.DataRow dealRow = DealHandler.napTheoID(dealId).Rows[0];

            // gán cho các thuộc tính để đẩy ra ngoài            
            gioiThieu = dealRow["GioiThieu"].ToString();
            tenDoanhNghiep = dealRow["TenDoanhNghiep"].ToString();

            // các địa chỉ
            repeater_DiaChi.DataSource = DiaChiDealhanlder.napTheoID(dealId);
            repeater_DiaChi.DataBind();

            // các bảng giá
            DataTable dtCacBangGia = new DataTable();
            dtCacBangGia = BangGiaDealHandler.napTheoID(dealId);
            repeater_BangGia.DataSource = dtCacBangGia;
            repeater_BangGia.DataBind();

            if (dtCacBangGia.Rows.Count > 1)
                soBangGiaNhieuHon1 = true;




        }
    }
}